package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load("@tink_java//tools/build_defs:javac.bzl", "JAVACOPTS_OSS")

filegroup(
    name = "srcs",
    srcs = glob(
        [
            "src/main/**/*.java",
        ],
    ),
)

java_library(
    name = "rewardedads",
    srcs = [":srcs"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        "@tink_java//:java",
        "@tink_java//:subtle",
        "@maven//:com_google_http_client_google_http_client",
        "@maven//:org_json_json",
    ],
)

# Maven Jars

load("@tink_java//tools:gen_maven_jar_rules.bzl", "gen_maven_jar_rules")

gen_maven_jar_rules(
    name = "maven",
    doctitle = "Tink Cryptography API for Google Mobile Rewarded Video Ads SSV",
    root_packages = ["com.google.crypto.tink.apps.rewardedads"],
    deps = [":rewardedads"],
)

# Tests

load("@tink_java//tools:gen_java_test_rules.bzl", "gen_java_test_rules")

java_library(
    name = "generator_test",
    testonly = 1,
    srcs = glob([
        "src/test/**/*.java",
    ]),
    deps = [
        ":rewardedads",
        "@tink_java//:testonly",
        "@maven//:com_google_http_client_google_http_client",
        "@maven//:junit_junit",
        "@maven//:org_json_json",
    ],
)

gen_java_test_rules(
    test_files = glob([
        "src/test/**/*Test.java",
    ]),
    deps = [
        ":generator_test",
    ],
)
